package cn.fzkj.springcloud.service.impl;

import cn.fzkj.springcloud.entity.Payment;
import cn.fzkj.springcloud.mapper.PaymentMapper;
import cn.fzkj.springcloud.service.PaymentService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class PaymentServiceImpl implements PaymentService {

    @Resource
    private PaymentMapper paymentMapper;

    @Override
    public int create(Payment payment) {
        if (payment == null) return 0;
        return paymentMapper.create(payment);
    }

    @Override
    public Payment getPaymentById(Long id) {
        if (id == null) {
            return new Payment();
        }
        return paymentMapper.getPaymentById(id);
    }
}
